<template>
        <div class>
          <el-card class="ep-card ep-search">
              <el-form :model="searchForm" label-width="80px">
                  <el-row :gutter="20">
                      <el-col :span="9">
                          <el-form-item label="客户名称" size="small"> 
                              <el-input v-model="searchForm.entName"  placeholder="请输入客户名称"></el-input>
                          </el-form-item>
                      </el-col>
                    <el-col :span="9">
                      <el-button type="primary" size="small" icon="el-icon-search" @click="init">查询</el-button>
                    </el-col>
                  </el-row>
              </el-form>
          </el-card>
          <el-table :data="tableData" border style="width: 100%" size="mini">
            <el-table-column type="index" label="序号" align="center" width="50">
            </el-table-column>
            <el-table-column prop="entNo" label="客户编号" align="center" width="260">
            </el-table-column>
            <el-table-column prop="entName" label="客户名称" align="center" width="120">
            </el-table-column>
            <el-table-column prop="createTime" label="咨询日期" align="center" width="120">
            </el-table-column>
            <el-table-column prop="serviceType"  align="center" label="业务类型">
            </el-table-column>
            <el-table-column prop="loanBank" align="center" label="申请贷款银行">
            </el-table-column>
            <el-table-column prop="applyDeadlines" align="center" label="申请期限">
            </el-table-column>
            <el-table-column prop="applyMoney" align="center" label="申请金额(万元)">
            </el-table-column>
            <el-table-column label="操作" align="center" width="100">
              <template slot-scope="scope">
                <el-button @click="handleClick(scope.row)" type="text" size="small">受理</el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-card style="text-align:right;">
            <el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="currentPage" :page-sizes="[ 10, 20,30, 40]" :page-size="pageSize" background layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
          </el-card>
        </div>
      </template>
      
      <script>
      export default {
        components: {},
        data() {
          return {
            total: 0,
            pageSize: 10,
            currentPage: 1,
            tableData: [],
            searchForm: {
                      entName: '',
            },
          };
        },
        computed: {},
        mounted() {
          this.init();
        },
        methods: {
          handleClick(row) {
            let path='/proj/projMain'
            let params={};
            params.entId= row.entId;
            params.projApplyId=row.id;
            this.$router.push({
                      path: path,
                      query: params
                  });
      
          },
          sizeChange(n) {
            this.pageSize = n;
            this.init();
          },
          currentChange(n) {
            this.currentPage = n;
            this.init();
          },
          init() {
            let user=JSON.parse(sessionStorage.getItem("user"));
            let dataSql="";
            if(user.grantOrganIds){
              dataSql=user.grantOrganIds;
            }
            let params = {
              pageNum: this.currentPage,
              pageSize: this.pageSize,
              entName: this.searchForm.entName,
              createUserId:user.id,
              createUserName:user.realName,
              dataSql:dataSql
            };
            this.$api.formPost(  "/api/biz/projectApply/doGetProjApplyList", params)
              .then(res => {
                if (res.retHead.code === "0000000") {
                  this.tableData = res.retBody.list;
                  this.total = res.retBody.total;
                }
              });
          }
        },
        created() {}
      };
      </script>
      <style lang='scss' scoped>
      </style>